<link href="static/css/top_style.css" type="text/css" rel="stylesheet" />


<div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title"> 资料贡献排行榜</h3>
    </div>
    <div class="panel-body">
     
			<div id="wrap">
			<div class="pagecolor16" id="t_container">
			<div id="modellist-1351482" class="md_5027 modelbox tleft" model-fun="bind_5003_scroll"> 

			<div class="md_cont slide_menu_box"> 
			<div class="md_citiao md_citiao_cross2">

	

			
			{% for x in ctx.res %}
			     {% if loop.index<4 %}
				  <div class="pbox star crossbox{{ loop.index }}">
				 {% else %}
				   <div class="pbox star2 crossbox{{ loop.index }}">
				 {% endif %}
				<div class="item bdcolor-q font18">
				<div style="float: left;" class="num fcolor b">{{ loop.index }}</div>
				<div class="title bgcolor-q" style="width:{{ x.sl/ctx.count.count*100 }}% ; float: left;"></div>
				<div style="float: left;"><a href="javascript:void(0);" id = 'user_{{ x.id }}'>{{ x.username }}<i class="song"></i></a></div>
				<div class="attention font14 oneline">
				<span class="att"><i class="iconfont icon-chakan"></i><a href="javascript:void(0);" onclick="show_detail({{ x.id }})">{{ x.sl }}</a></span>
				</div>
				</div>
				</div>
			{% endfor%}
		
			{% for x in ctx.more %}
			     {% if x<4 %}
				  <div class="pbox star crossbox{{ x }}">
				 {% else %}
				   <div class="pbox star2 crossbox{{ x }}">
				 {% endif %}
				<div class="item bdcolor-q font18">
				<div style="float: left;" class="num fcolor b">{{ x }}</div>
				<div class="title bgcolor-q" style="width:0%;float: left;"></div>
				<div style="float: left;"><a href="javascript:void(0);" >虚位以待<i class="song"></i></a> </div>
				<div class="attention font14 oneline">
				<span class="att"><i class="iconfont icon-chakan"></i>---</span>
				</div>
				</div>
				</div>
			{% endfor %}

			

			</div>
			</div>
			</div>
			</div>
			</div>


    </div>
  </div>
       <div class="modal right fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>                
                <h4 class="modal-title" id="myModalLabel"></h4>
              </div>
              <div class="modal-body" ">
              	<div id='loading_img'></div>
                <div style="font-size:larger;font-family: \96B6\4E66; align:center;">

						<table class="table">
				            <thead>
				              <tr>
				                <th>序号</th>
				                <th>名称</th>
				                <th>类型</th>
				                <th>国家</th>
				                <th>贡献时间</th>
				              </tr>
				            </thead>
				            <tbody  id="tab_gxxx" >

				            </tbody>
				          </table>
                </div>

              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
              </div>
            </div>
          </div>
      </div>

<script type="text/javascript">

		function show_detail(id){

			let user_name = $('#user_'+id).text() 
			$.ajax({
                  //请求方式
                  type : "GET",
                  //数据类型
                  dataType: 'json',
                  //请求地址
                  url : "/top_gxxx",
                  //数据，json字符串
                  data : {'user_id':id},
                  beforeSend: function(request) {
                    let loading_html = '<div class ="row"  style="margin-left: 50%"><img src="static/img/loading.gif"></div> '  
                    $('#myModalLabel').text(user_name+'的贡献信息')
                    $('#loading_img').html(loading_html)
                    $('#myModal').modal('show')
                  }, 
                  //请求成功
                  success : function(rs) {
                    $('#loading_img').html('')
                    let tab_html = ''
                    for(let i =0;i<rs.length;i++){
                    	tab_html+='<tr><td>'+(i+1)+'</td><td>'+rs[i].need_name+'</td><td>'+rs[i].country+'</td><td>'+rs[i].lx+'</td><td>'+rs[i].lrrq+'</td></tr>'
                    }
					$('#tab_gxxx').html(tab_html)

                  },
                  //请求失败，包含具体的错误信息
                  error : function(e){
                      alert('请求失败')
                  }
              });







		} 

</script>



